<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <script type="text/javascript">
        	window.onload=function(){
		       	 function getMyDate(str){  
		            // var oDate = new Date(str); 
		            // console.log(oDate);
		            // oYear = oDate.getFullYear(); 
		            // console.log(oYear); 
		            // oMonth = oDate.getMonth()+1;  
		            // oDay = oDate.getDate();
		            // oHour = oDate.getHours();  
		            // oMin = oDate.getMinutes();  
		            // oSen = oDate.getSeconds();  
		            // oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +' '+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间  
		            // return oTime;  
		            // Date里面没有参数，获取的是当前时间
		            // 有参数，参数是从起始时间1970年1月1日的毫秒数
		             var date = new Date(str);
 
				     var year = date.getFullYear();
				     var month = date.getMonth()+1;    //js从0开始取 
				     var date1 = date.getDate(); 
				     var hour = date.getHours(); 
				     var minutes = date.getMinutes(); 
				     var second = date.getSeconds();
				 
				     var ftime=date+"  |  "+year+"年"+month+"月"+date1+"日"+hour+"时"+minutes +"分"+second+"秒" ;
				     return ftime;
		        }
		        //补0操作  
		        function getzf(num){  
		            if(parseInt(num) < 10){  
		                num = '0'+num;  
		            }  
		            return num;  
		        }  
		        console.log(getMyDate(1486551202*1000));
        	}
        </script>
    </head>
    <body>
    </body>
</html>